#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
	vector<int> searchRange(vector<int>& nums, int target) {
		int left = 0,right=nums.size()-1;
		vector<int>ret;
		while (ret.size() != 2)
		{
			if (nums[right] == target)
				ret.push_back(right);
			if (nums[left] == target)
				ret.push_back(left);
		}
		return ret;

	}
};
int main()
{
	vector<int>nums = { 5, 7, 7, 8, 8, 10 };
	int target = 8;
	Solution A;
	vector<int>ret=A.searchRange(nums, target);
	for (int e:ret)
	{
		cout << e << ',';
	}
	
	return 0;
}